<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <style>
        .box{
            width: 200px;
            height: 200px;
            background-color: red;
            border: 1px solid black;
            font-size: 3em;
        }
        .two{
            background-color: blue;
            /* 绝对定位 */
            position: absolute;
            /* 边偏移 */
            top: 100px;
            left: 100px;
            /* z轴的层级，数值越大，层级越高 */
            z-index: 3;
        }
        .three{
            position: absolute;
            background-color: aquamarine;
            left: 50px;
            top: 50px;
            z-index: 2;
        }
        .four{
            position: absolute;
        }
        
        /* 以父节点左上角为原点，前提是父节点必须设置 position 属性，
        relative 或者 absolute 都行。一旦没有父节点，
        或者父节点没有设置position属性，则以浏览器左上角为原点 */
        .four-1{
            width: 80px;
            height: 80px;
            background-color: orange;
            position: absolute;
            left: 20px;
            top: 20px;
        }
    </style>
</head>
<body>
    <div class="box one">1</div>
    <div class="box two">2</div>
    <div class="box three">3</div>
    <div class="box four">
        <div class="four-1">4-1</div>
    </div>
</body>
</html>